package com.spzx.product.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.BaseEntity;

import java.io.Serial;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * <p>
 * 商品单位
 * </p>
 *
 * @author Haoran Sun
 * @since 2024-07-15
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("product_unit")
@Schema(description = "商品的单位")
public class ProductUnit extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品的单位名称")
    @TableField("name")
    @NotNull(message = "商品单位名称不能为空")
    @Size(min = 0,max = 10,message = "商品单位名称长度不能超过10个字符")
    private String name;
}
